import request from '@/router/axios';

export const getList = (parentId, params) => {
    return request({
        url: '/api/mes-admin/area/lazy-list',
        method: 'get',
        params: {
            ...params,
            parentId
        }
    })
}

export const getAreaTree = (tenantId) => {
    return request({
        url: '/api/mes-admin/area/tree',
        method: 'get',
        params: {
            tenantId,
        }
    })
}

export const getDetail = (id) => {
    return request({
        url: '/api/mes-admin/area/detail',
        method: 'get',
        params: {
            id
        }
    })
}

export const remove = (ids) => {
    return request({
        url: '/api/mes-admin/area/remove',
        method: 'post',
        params: {
            ids,
        }
    })
}

export const add = (row) => {
    return request({
        url: '/api/mes-admin/area/submit',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/api/mes-admin/area/submit',
        method: 'post',
        data: row
    })
}

